﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/UserUI/User.Master" AutoEventWireup="true"
    CodeBehind="SalesEntry.aspx.cs" Inherits="BoutiquePOS.UI.UserUI.SalesEntry" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../../Styles/UserUI/Common.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/UserUI/PurchaseEntryCss.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/AutoComplete/jquery-1.js" type="text/javascript"></script>
    <script src="../../Scripts/AutoComplete/jquery-ui.js" type="text/javascript"></script>
    <link href="../../Scripts/AutoComplete/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

        $(function () {
            var availableTags = [ <%= SuggestionList %>];

            $("#<%=productNameTextBox.ClientID %>").autocomplete({
                source: availableTags
            });
        });  
        
        function validation() {
             if (document.getElementById('<% =customerIdTextBox.ClientID %>').value == "") {
                 document.getElementById('<%=messageLebel.ClientID %>').textContent = "Customer Id cannot be blank ";
                 document.getElementById('<%=messageLebel.ClientID%>').style.color = "red";
                 document.getElementById('<% =customerIdTextBox.ClientID %>').focus();
                 return false;
             } 
            if (document.getElementById('<% =paidAmountTextBox.ClientID %>').value == "") {
                document.getElementById('<%=messageLebel.ClientID %>').textContent = "Paid amount cannot be blank ";
                document.getElementById('<%=messageLebel.ClientID%>').style.color = "red";
                document.getElementById('<% =paidAmountTextBox.ClientID %>').focus();
                return false;
            }
             return true;
         }
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<<<<<<< .mine
    <!---Start Customer Entry Popup---->
    <ajax:ToolkitScriptManager runat="server" ID="scriptmanager1">
    </ajax:ToolkitScriptManager>
    <ajax:DragPanelExtender ID="dragpnl" runat="server" TargetControlID="pnllogin" DragHandleID="pnldrag" />
    <ajax:ModalPopupExtender ID="modalpopup1" runat="server" BackgroundCssClass="modalPopup"
        TargetControlID="btnshowCustomer" PopupControlID="pnllogin" />
    <asp:Panel ID="pnllogin" runat="server">
        <div style="width: 400px">
            <asp:Panel ID="pnldrag" runat="server">
                <table class="Dialog" width="100%">
                    <tr style="background-image: url(../../Icons/bg_filter_header.gif)" class="TitleBar">
                        <td style="color: white">
                            <img src="../../Icons/close.gif" align="right" style="cursor: pointer" alt="Close"
                                onclick="ClosePopup()" />Enter Customer Details
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table width="100%" border="0px" align="center" style="">
                                <tr>
                                    <td colspan="2" style="text-align: center">
                                        <asp:Label runat="server" ID="msgCutomerPanel"></asp:Label>
                                    </td>
                                </tr>
                                <!-- login id -->
                                <tr>
                                    <td align="right">
                                        Customer ID
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="txtCustomerID" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        Full Name
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="txtCustomerFullname" runat="server" re></asp:TextBox>
                                    </td>
                                </tr>
                                <!-- password -->
                                <tr>
                                    <td align="right">
                                        Phone
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="txtCustomerPhone" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        Email
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="txtCustomerEmail" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                        <asp:Button ID="btnsubmit" runat="server" Text="Submit" CssClass="Button" OnClick="SaveCustomer" />
                                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="Button" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </div>
    </asp:Panel>
    <script type="text/javascript">
        function setBodyContentHeight() {
            document.body.style.height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) + "px";
        }
        setBodyContentHeight();
        function ClosePopup() {
            //Hide the modal popup - the update progress
            var popup = $find('<%= modalpopup1.ClientID %>');
            if (popup != null) {
                popup.hide();
            }
        }
    </script>
    <!---End Customer Entry Popup---->
=======
>>>>>>> .r17
    <div class="contentHolderDiv">
        <fieldset>
            <div class="msgDiv">
                <asp:Label ID="messageLebel" runat="server"></asp:Label>
            </div>
            <fieldset>
                <legend>Sales Entry</legend>
                <table width="100%">
                    <tr>
                        <td class="lebelField">
                            Customer ID
                        </td>
                        <td class="inputLebel">
                            <table width="100%">
                                <tr>
                                    <td>
                                        <asp:TextBox runat="server" ID="customerIdTextBox" CssClass="textBoxDesignCusID"
                                            AutoPostBack="True" OnTextChanged="customerIdTextBox_TextChanged"></asp:TextBox>
                                    </td>
                                    <td>
                                        <a href="#">
                                            <img src="../../Icons/newCustomer.png" alt="customerNewBtn" /></a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td class="lebelField">
                            Invoice No
                        </td>
                        <td class="inputLebel">
                            <input type="text" id="salesNoTextBox" runat="server" tabindex="1" class="textBoxDesign" />
                        </td>
                        <td class="lebelField">
                            Sales Date
                        </td>
                        <td class="inputLebel">
                            <input type="text" id="salesDateTextBox" runat="server" tabindex="2" class="textBoxDesign" />
                        </td>
                    </tr>
                    <tr>
                        <td class="lebelField">
                            Product Category
                        </td>
                        <td>
                            <asp:DropDownList ID="productCategoryDDList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="productCategoryDDList_SelectedIndexChanged"
                                TabIndex="5" CssClass="dropDownDesign">
                            </asp:DropDownList>
                        </td>
                        <td class="lebelField">
                            PaymentMode
                        </td>
                        <td>
                            <select id="selectPaymentMode" runat="server" tabindex="3" class="dropDownDesign">
                                <option value="--Select Mode--">--Select Mode--</option>
                                <option value="1">Cash</option>
                                <option value="2">Credit</option>
                            </select>
                        </td>
                    </tr>
                </table>
                <table width="100%">
                    <tr>
                        <td class="lebelField">
                            Total Amount
                        </td>
                        <td>
                            <input type="text" id="totalNetAmtTextBox" runat="server" class="textBoxDesign" />
                        </td>
                        <td class="lebelField">
                            Paid Amount
                        </td>
                        <td class="inputLebel">
                            <asp:TextBox ID="paidAmountTextBox" runat="server" AutoPostBack="True" OnTextChanged="paidAmtTextBox_TextChanged"
                                CssClass="textBoxDesign"></asp:TextBox>
                        </td>
                        <td class="lebelField">
                            Due Amount
                        </td>
                        <td>
                            <input type="text" id="dueAmtTextBox" runat="server" class="textBoxDesign" />
                        </td>
                    </tr>
                </table>
            </fieldset>
            <fieldset>
                <legend>Product Entry</legend>
                <table class="productTB">
                    <tr>
                        <td>
                            Product Name
                        </td>
                        <td>
                            Qty
                        </td>
                        <td>
                            TP
                        </td>
                        <td>
                            MRP
                        </td>
                        <td>
                            Tot MRP
                        </td>
                        <td>
                            Dis. Per
                        </td>
                        <td>
                            Dis. Amt
                        </td>
                        <td>
                            Free Qty
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="text" id="productNameTextBox" runat="server" class="SmalltextBoxProduct" />
                        </td>
                        <td>
                            <asp:TextBox ID="qtyTextBox" runat="server" OnTextChanged="qtyTextBox_TextChanged"
                                AutoPostBack="True" CssClass="SmalltextBox"></asp:TextBox>
                        </td>
                        <td>
                            <input type="text" id="tradePriceTextBox" runat="server" class="SmalltextBox" />
                        </td>
                        <td>
                            <input type="text" id="mrpTextBox" runat="server" class="SmalltextBox" />
                        </td>
                        <td>
                            <input type="text" id="totalMRPTextBox" runat="server" class="SmalltextBox" />
                        </td>
                        <td>
                            <asp:TextBox ID="discountPercentTextBox" runat="server" AutoPostBack="True" CssClass="SmalltextBox"
                                OnTextChanged="discountPercentTextBox_TextChanged"></asp:TextBox>
                        </td>
                        <td>
                            <input type="text" id="discountAmtTextBox" runat="server" class="SmalltextBox" />
                        </td>
                        <td>
                            <input type="text" id="freeQtyTextBox" runat="server" class="SmalltextBox" />
                        </td>
                        <td>
                            <input id="addButton" type="button" value="Add" runat="server" class="addbutton"
                                onserverclick="AddtoGridView_Click" />
                        </td>
                    </tr>
                </table>
            </fieldset>
            <fieldset>
                <div class="gridLoadDiv">
                    <asp:GridView ID="salesGridView" runat="server" AutoGenerateColumns="False" CellPadding="4"
                        ForeColor="Black" Width="849px" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None"
                        BorderWidth="1px" GridLines="Vertical">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField HeaderText="Id">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("AProduct.ProductId") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("AProduct.ProductId") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Product Name">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("AProduct.ProductBrandName") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("AProduct.ProductBrandName") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="salesQty" HeaderText="Qty" />
                            <asp:BoundField DataField="TradePrice" HeaderText="Unit Price" />
                            <asp:BoundField DataField="MRP" HeaderText="MRP" />
                            <asp:BoundField DataField="TotalMRP" HeaderText="Total MRP" />
                            <asp:BoundField DataField="DiscountPer" HeaderText="Dis. Per"></asp:BoundField>
                            <asp:BoundField DataField="DiscountAmt" HeaderText="Dis.Amt." />
                            <asp:BoundField DataField="SalesFreeQty" HeaderText="Free Qty" />
                            <asp:CommandField ShowEditButton="True" />
                            <asp:CommandField ShowSelectButton="True" />
                        </Columns>
                        <FooterStyle BackColor="#CCCC99" />
                        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                        <RowStyle BackColor="#F7F7DE" />
                        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                        <SortedAscendingCellStyle BackColor="#FBFBF2" />
                        <SortedAscendingHeaderStyle BackColor="#848384" />
                        <SortedDescendingCellStyle BackColor="#EAEAD3" />
                        <SortedDescendingHeaderStyle BackColor="#575357" />
                    </asp:GridView>
                </div>
            </fieldset>
            <fieldset>
                <table class="afterGdvTB" width="100%">
                    <tr>
                        <td colspan="6">
                            <div class="myAllButton">
                                <input id="saveButton" type="button" value="Save" runat="server" onserverclick="SaveButton"
                                    class="Belowbutton" />&nbsp;
                                <input id="clearButton" type="button" value="Clear" runat="server" onserverclick="ClearButton"
                                    class="Belowbutton" />&nbsp;
                                <input id="closeButton" type="button" value="Close" runat="server" onserverclick="CloseButton"
                                    class="Belowbutton" />&nbsp;
                            </div>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </fieldset>
    </div>
</asp:Content>
<%--<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
--%>